<h2>Настройки</h2>
<style>
    .edit
    {
        font-size:9px;
    }
</style>
<script type="text/javascript">
    $(document).ready(function(){

        $("div.main-text table.z tr:not(:first):odd").css("background", "#eee");    


        $(".topic_edit").click(
        function ()
        {
            var main = $("#main");
            var load = $("#load");

            load.fadeIn('slow');

            $.ajax({
                type: "POST", url: "admin.php?page=topic.edit&type=ajax&topic_id="+this.id, data: "",

                complete: function(data)
                {
                    result = data.responseText;
                    main.html( result );
                    load.fadeOut('slow');
                }
            });
        }
        );             


    });

</script>     
<div class="main-text" style="width:100%">
    <?php
        $option_array = option::get( array( 'where' => 'option_group="system"' ) );

        if ( count($option_array) > 0 )
        {
        ?>   
        <table border="0" class="z" width="100%" cellspacing="2" cellpadding="2">
            <tr class="dataTableHeadingRow" align="left">
                <td class="dataTableHeadingContent" width="20px"><input type="checkbox" id="select_all" /></td>
                <td class="dataTableHeadingContent" width="100px" >Опция</td>
                <td class="dataTableHeadingContent" width="*" >Значение</td>
                <td class="dataTableHeadingContent" width="30px">Действие</td>   
            </tr>
            <?php

                $color = '';
                foreach ( $option_array as $num => $value )
                {
                    $option_value =  $value['option_value'];
                    $option_value = m::cutString( $option_value ); 


                    echo '<tr id="t'.$value['option_id'].'">' . "\n"; 
                    echo '<td align="center" valign="center"><input type="checkbox" name="topic" id="c'.$value['option_id'].'" value="" /></td>';
                    echo '<td align="center" valign="center">'.$value['option_id'].'</td>';
                    echo '<td class="dataTableContent" align="left" valign="middle">'.$value['option_name'].'</td>'. "\n"; ;
                    echo '<td class="dataTableContent" align="left" valign="middle">'.$option_value.'</td>'. "\n"; ;
                    echo '<td class="dataTableContent" align="center" valign="middle"><a class="topic_edit" id="'.$value['option_id'].'"><img src="'.http_path('icons').'page_white_edit.png"></a></td>'. "\n"; ;
                    echo '</tr>';
                }

            ?> 
        </table>
        <table border="0" width="100%" cellspacing="2" cellpadding="2">
            <tr>
                <td colspan="2">
                    <?php


                        echo '<i>Всего:&nbsp;'.option::total().'</i>';
                    ?>
                </td>
                <td colspan="2">
                </td>
            </tr>         
        </table>
        <?php

        }
        else
        {

            echo 'нет опций';
        }

    ?>
</div>